package com.lichuang.dedao.curriculum.controller;


import com.lichuang.dedao.curriculum.entity.CurriculumSection;
import com.lichuang.dedao.curriculum.service.impl.CurriculumSectionServiceImpl;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaosong
 * @since 2019-07-18
 */
@RestController
@RequestMapping("//curriculum-section")
public class CurriculumSectionController {

    @Autowired
    private CurriculumSectionServiceImpl curriculumSectionService;

    @RequestMapping("/updateSectionStatusById")
    public Integer updateSectionStatusById(@RequestParam("id")Integer id,@RequestParam("status")Integer status){
        return curriculumSectionService.updateSectionStatusById(id,status);
    }

    @RequestMapping("/getSectionByChapterId")
    public List<CurriculumSection> getSectionByChapterId(@RequestParam("chapterId")Integer chapterId){
        return curriculumSectionService.getSectionByChapterId(chapterId);
    }

}
